package me.zixing.java.chapter03;

/**
 * Created by bingh on 2017/9/20.
 */
public class Gauger {
    private String name;
    private int age;
    private float height;
    private float weight;

    public Gauger() {
    }

    public Gauger(String name, int age, float height, float weight) {
        this.name = name;
        this.age = age;
        this.height = height;
        this.weight = weight;
    }


    //增加判断体重在正常范围

    public boolean isNormal(double BMI){
        boolean flag = false;

        if(BMI>=18 && BMI <=25){
            flag = true;
        }

        return flag;
    }


    //增加判断肥胖

    public boolean isFat(double BMI){
        boolean flag = false;

        if(BMI >= 30){
            flag = true;
        }

        return flag;
    }

    private double calculateBMI(){
        double BMI = this.weight / Math.pow(this.height,2);
        return BMI;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public float getHeight() {
        return height;
    }

    public void setHeight(float height) {
        this.height = height;
    }

    public float getWeight() {
        return weight;
    }

    public void setWeight(float weight) {
        this.weight = weight;
    }
}
